package com.en;

//import org.mybatis.spring.annotation.MapperScan;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;

import java.io.File;

@SpringBootApplication
//@MapperScan(basePackages = {"com.tencent.wxcloudrun.mapper"})
@ServletComponentScan
public class Application {

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);


//        handleJPEG();
    }

    //    把.jpeg 缓存 .jpg
    public static void handleJPEG() {
        String property = System.getProperty("user.dir");
        String codePath = property + File.separator + "src" + File.separator + "main" + File.separator + "java" + File.separator + "com" + File.separator + "tencent" + File.separator + "wxcloudrun" + File.separator;

        File dir = new File(codePath + "word_images");
        for (File file : dir.listFiles()) {
            System.out.println(file.getName());
            String name = file.getName();
            if (name.endsWith("jpeg")) {
                file.renameTo(new File(codePath + "word_images" + File.separator + name.replace(".jpeg", ".jpg")));
                file.delete();
            }
        }
    }
}
